/**
 * @file         rte_bsc_gb17691_frame_collect.h
 * @brief        
 * @note
 * @author       DengDeShou(dengdeshou@hopechart.com,邓德守)
 * @date         2020/11/06
 * @version      1.0
 *
 * @par          修改日志
 * <table>
 * <tr><th>Date        <th>Version               <th>Author          <th>Description
 * <tr><td>2020/11/06  <td>1.0                   <td>Dengdeshou      <td>创建初始版本
 * @copyright    杭州鸿泉物联网技术股份有限公司
 */
 
#ifndef _RTE_BSC_GB17691_FRAME_COLLECT_H_
#define _RTE_BSC_GB17691_FRAME_COLLECT_H_

#include "ofc/ofc_types.h"
#include "ofc/ofc_object.h"
#include "gbmsg17691/gbc_17691_ds_interface.h"
#include "bsc_hj1239/bsc_hj1239_channel.h"


enum TBsHj1239CollectDataSizeTag
{
    kBsHj1239CollectDataSizeObd = sizeof(TGbc17691MsgStreamItem) + sizeof(TGbc17691ObdMessage) + sizeof(UInt32) * 255,
    kBsHj1239CollectDataSizeRealStream = sizeof(TGbc17691MsgStreamItem) + sizeof(TGbc17691EngineStream),
    kBsHj1239CollectDataSizeFixStream = sizeof(TGbc17691MsgStreamItem) + sizeof(TGbc17691ExtData),
};
typedef enum TBsHj1239CollectDataSizeTag TBsHj1239CollectDataSize;

#ifdef __cplusplus
extern "C" {
#endif

typedef struct TBsHj1239ChlCollectTag TBsHj1239ChlCollect;
struct TBsHj1239ChlCollectTag
{
    Bool    is_login;

    UInt8   obd_queue_id;
    UInt8   real_ds_queue_id;
    UInt8   fix_ds_queue_id;

    UInt8   history_real_ds_queue_id;
    UInt8   history_fix_ds_queue_id;

    UInt16  collect_buff_size;
    UInt8   *collect_buff;
};


/**
 * 采集OBD数据  --->>  0x01
 * @param *self         采集对象接口
 * @param time_utc8     采集时间, utc8时间
 * @return >= 0 成功
 *         <  0 失败
 */
Int32 TBsHj1239ChlCollectObdData(TBsHj1239ChlCollect *self, TTime time_utc8);


/**
 * 采集补充数据流数据  --->>  0x80
 * @note 未实现
 * @param *self         采集对象接口
 * @param time_utc8     采集时间, utc8时间
 * @return >= 0 成功
 *         <  0 失败
 */
Int32 TBsHj1239ChlCollectFixData(TBsHj1239ChlCollect *self, TTime time_utc8);


/**
 * 保存全部的数据流数据  --->>  0x02 0x03 0x04 0x05
 * @param *self         采集对象接口
 * @param time_utc8     采集时间, utc8时间
 * @return >= 0 成功
 *         <  0 失败
 */
Int32 TBsHj1239ChlCollectAllStreamData(TBsHj1239ChlCollect *self, TTime time_utc8, UInt32 cmd_mask);


#ifdef __cplusplus
}
#endif
#endif
